import Layout from "@/views/Layout/AppContent.vue";

/* meta参数，title为当前页标题，color为当前页header背景色，noArrow为当前页是否需要返回按钮，不需要则无需设置 */
const router = [
  /* 总览 */
  {
    path: "/home",
    redirect: "/home/index",
    name: "home",
    component: Layout,
    children: [
      {
        path: "index",
        component: () => import("@/views/Home/index.vue"),
        meta: {
          name: "homeIndex",
          title: "上海市工业技术学校",
          color: "home",
          noArrow: true
        }
      },
      {
        path: "statistics",
        component: () => import("@/views/Home/Statistics.vue"),
        meta: {
          name: "homeStatistics",
          title: "统计信息",
          color: "blue"
        }
      },
      {
        path: "alarm",
        component: () => import("@/views/Home/Alarm.vue"),
        meta: {
          name: "homeAlarm",
          title: "消息告警",
          color: "red1"
        }
      },
      {
        path: "alarmDetail",
        component: () => import("@/views/Home/AlarmDetail.vue"),
        meta: {
          name: "homeAlarmDetail",
          title: "告警基本信息",
          color: "red1"
        }
      },
      {
        path: "report",
        component: () => import("@/views/Home/Report.vue"),
        meta: {
          name: "homeAlarm",
          title: "处置上报",
          color: "red2"
        }
      },
      {
        path: "reportDetail",
        component: () => import("@/views/Home/ReportDetail.vue"),
        meta: {
          name: "homeReportDetail",
          title: "处置上报",
          color: "red2"
        }
      },
      {
        path: "onePage",
        component: () => import("@/views/Home/onePage.vue"),
        meta: {
          name: "onePage",
          title: "一号楼",
          color: "red2"
        }
      }
    ]
  },
  {
    path: "/digital",
    redirect: "/digital/index",
    name: "digital",
    component: Layout,
    children: [
      {
        path: "index",
        component: () => import("@/views/Digital/index.vue"),
        meta: {
          name: "digitalIndex",
          title: "数字校园",
          color: "darkBlue",
          noArrow: true
        }
      },
      {
        path: "device",
        component: () => import("@/views/Digital/Device.vue"),
        meta: {
          name: "digitalDevice",
          title: "智能设备",
          color: "darkBlue"
        }
      },
      {
        path: "deviceDetail",
        component: () => import("@/views/Digital/DeviceDetail.vue"),
        meta: {
          name: "digitalDeviceDetail",
          title: "处置登记",
          color: "red1"
        }
      },
      {
        path: "air",
        component: () => import("@/views/Digital/Air.vue"),
        meta: {
          name: "digitalAir",
          title: "空气质量监测",
          color: "darkBlue"
        }
      },
      {
        path: "light",
        component: () => import("@/views/Digital/Light.vue"),
        meta: {
          name: "digitalLight",
          title: "智能灯光控制",
          color: "darkBlue"
        }
      },
      {
        path: "lightSet",
        component: () => import("@/views/Digital/LightSet.vue"),
        meta: {
          name: "digitalLightSet",
          title: "设置定时开关",
          color: "darkBlue"
        }
      }
    ]
  },
  {
    path: "/mine",
    redirect: "/mine/index",
    name: "mine",
    component: Layout,
    children: [
      {
        path: "index",
        component: () => import("@/views/Mine/index.vue"),
        meta: {
          name: "mineIndex",
          title: "我的",
          color: "red3",
          noArrow: true
        }
      },
      {
        path: "changePassword",
        component: () => import("@/views/Mine/ChangePassword.vue"),
        meta: {
          name: "changePassword",
          title: "我的",
          color: "red3"
        }
      },
      {
        path: "feedback",
        component: () => import("@/views/Mine/feedback.vue"),
        meta: {
          name: "feedback",
          title: "我的",
          color: "red3"
        }
      }
    ]
  }
];
export default router;
